var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var EventManager = require("AA_EventManager");
var ResKeeper = require("AA_ResKeeper");
var EvenType = require("AA_EvenType");
var RedPointControl = require("AA_RedPointControl");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
_decorator.inspector;
var _def_RedPointItem = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.redPoints = [];
    t.redPointNode = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    this.Show();
    EventManager.EventMgr.addEventListener(EvenType.EVENT_TYPE.MainRedPointChange, this.OnRedPointChange, this);
  };
  _creator.prototype.onDisable = function () {
    EventManager.EventMgr.rmEventListener(EvenType.EVENT_TYPE.MainRedPointChange, this.OnRedPointChange, this);
  };
  _creator.prototype.Show = function () {
    var e = false;
    for (var t = 0; t < this.redPoints.length; t++) {
      var o = this.redPoints[t];
      if (RedPointControl.RedPointCtrl.GetRedPointByType(o)) {
        e = true;
        break;
      }
    }
    this.redPointNode.active = e;
  };
  _creator.prototype.OnRedPointChange = function (e) {
    e && -1 == this.redPoints.indexOf(e) || this.Show();
  };
  __decorate([_property({
    type: [cc.Enum(RedPointControl.RedPointType)],
    tooltip: "需要完成的红点类型"
  })], _creator.prototype, "redPoints", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "redPointNode", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_RedPointItem;